﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.Mvc;
namespace RBAC.Web.Models
{
    public class DomainModel: BaseModel
    {

        //Autokey NOT PK
        [DisplayName("Id")]
        public int Id { get; set; }

        //Pk NOT Autokey
        [Required]
        [StringLength(255, ErrorMessage = "DomainName cannot be longer than 255 characters.")]
        [Remote("doesDomainNameExist", "Domain", HttpMethod = "POST", AdditionalFields = "Mode, OldValue", ErrorMessage = "DomainName already exists. Please enter a different DomainName")]
        [DisplayName("DomainName")]
        public String DomainName { get; set; }


        [Required]
        [StringLength(255, ErrorMessage = "Description cannot be longer than 255 characters.")]
        [DisplayName("Description")]
        public String Description { get; set; }

        /*Master Detail*/
        public List<FunctionModel> Functions { get; set; }

        // For PopLookup
        public List<DomainModel> ListOfDomain { get; set; }
        public string[] RequiredFields { get; set; }
    }
}